/**
 * 
 */
package action;

import model.User;

import com.opensymphony.xwork2.ActionSupport;

import dao.UserDao;

/**
 * @author shenli
 *
 */
public class RegisterAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private User user;
	private String repassword;
	public void setUser(User user) {
		this.user = user;
	}
	public User getUser() {
		return user;
	}
	public void setRepassword(String repassword) {
		this.repassword = repassword;
	}
	public String getRepassword() {
		return repassword;
	}
	
	public String execute(){
		User u=new User();
		u.setUsername(user.getUsername());
		u.setPassword(user.getPassword());
		UserDao dao=new UserDao();
		dao.saveUser(u);
		return SUCCESS;
	}
}
